<!-- <template>
	<view>
		<view style="margin-top: 108rpx;">hjkjl</view>
		<view v-html="obj.content"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: null,
				obj: {}
			}
		},
		onLoad(e) {
			this.id = e.id
		},
		mounted() {
			this.detail(this.id)
		},
		methods: {
			detail() {
				let _this = this
				uni.request({
					url: _this.$url + '/index/index/getNewsDetail',
					method: 'GET',
					data: {
						id: this.id
					},
					success(res) {
						console.log(res.data.data)
						_this.obj = res.data.data

					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.news {
		max-height: 100vh;
	}

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}
</style> -->

<template>
	<view class="news tn-safe-area-inset-bottom">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar fixed>新闻详情</tn-nav-bar>
		<view style="margin-top: 200rpx;">

			<!-- <button @click="goCustomer">在线客服</button> -->
			<view class="title">
				{{obj.title}}
			</view>
			<view class="time">
				{{obj.update_time}}
			</view>
			<view style="padding: 0 15rpx;" v-html="obj.content"></view>

		</view>


		<view class='tn-tabbar-height'></view>
	</view>
</template>

<script>
	import {
		getArtcileList,
		getArticleCateList
	} from "@/utils/api/article.js"
	export default {
		name: 'News',
		data() {
			return {
				id: null,
				obj: {}
			}
		},
		onLoad(e) {
			this.id = e.id
		},
		mounted() {
			this.detail(this.id)
		},
		methods: {
			detail() {
				let _this = this
				uni.request({
					url: _this.$url + '/index/index/getNewsDetail',
					method: 'GET',
					data: {
						id: this.id
					},
					success(res) {
						console.log(res.data.data)
						_this.obj = res.data.data

					}
				})
			},
			goCustomer() {
				wx.openCustomerServiceChat({
					extInfo: {
						url: 'https://work.weixin.qq.com/kfid/kfce1fdacdc738530f9'
					},
					corpId: 'wwbeb59c1334e9ce8f',
					success(res) {}
				})

				// wx.openCustomerServiceChat({
				// 	//企业微信的企业id
				// 	corpId: 'ww864535e0dd40a177',
				// 	extInfo: {
				// 		//客服链接
				// 		url: 'https://work.weixin.qq.com/kfid/kfcc127d26fbf2bc380'
				// 	},
				// 	success: (e) => {
				// 		alert('chenggong')
				// 	},
				// 	fail: (err) => {
				// 		console.log('err', err)
				// 	}
				// })

			}

		},
		onReachBottom() {}
	}
</script>

<style lang="scss" scoped>
	.title {}

	.news {
		max-height: 100vh;
	}

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}
	.tn-safe-area-inset-bottom{
		.title {
			font-size: 32rpx;
			text-align: center;
			margin-bottom: 30rpx;
		}
		.time {
			font-size: 24rpx;
			text-align: center;
			margin-bottom: 30rpx;
		}
	}
.time{
	color: #6d6a6a;
}

	/* 文章内容 end*/
</style>